Telegram Group & Telegram Channel
23. Christmas tree.

class ChristmasTree
{
public static final int segments = 4;
public static final int height = 4;

public static void main(String[] args)
{
makeTree();
}

public static void makeTree()
{
int maxStars = 2 * height + 2 * segments - 3;
String maxStr = "";
for (int l = 0; l < maxStars; l++)
{
maxStr += " ";
}

for (int i = 1; i <= segments; i++)
{
for (int line = 1; line <= height; line++)
{
String starStr = "";
for (int j = 1; j <= 2 * line + 2 * i - 3; j++)
{
starStr += "*";
}

for (int space = 0; space <= maxStars - (height + line + i); space++)
{
starStr = " " + starStr;
}
System.out.println(starStr);
}
}

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2 - 3; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*******");
}
}

@java_Codings



tg-me.com/java_codings/34
Create:
Last Update:

23. Christmas tree.

class ChristmasTree
{
public static final int segments = 4;
public static final int height = 4;

public static void main(String[] args)
{
makeTree();
}

public static void makeTree()
{
int maxStars = 2 * height + 2 * segments - 3;
String maxStr = "";
for (int l = 0; l < maxStars; l++)
{
maxStr += " ";
}

for (int i = 1; i <= segments; i++)
{
for (int line = 1; line <= height; line++)
{
String starStr = "";
for (int j = 1; j <= 2 * line + 2 * i - 3; j++)
{
starStr += "*";
}

for (int space = 0; space <= maxStars - (height + line + i); space++)
{
starStr = " " + starStr;
}
System.out.println(starStr);
}
}

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*" + " ");

for (int i = 0; i <= maxStars / 2 - 3; i++)
{
System.out.print(" ");
}

System.out.println(" " + "*******");
}
}

@java_Codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/34

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

Advance Java ‍ from de


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA